home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / MoreFiles 1.1.1 / FSpCompat.p < prev    next >
Encoding:
Text File  |  1994-01-17  |  5.5 KB  |  179 lines  |  [TEXT/PJMM]

  1. UNIT FSpCompat;
  2.  
  3.  
  4.  
  5. {    Apple Macintosh Developer Technical Support                                }
  6. {                                                                            }
  7. {    FSSpec compatibility functions                                            }
  8. {                                                                            }
  9. {    by Jim Luther, Apple Developer Technical Support                        }
  10. {                                                                            }
  11. {    File:        FSpCompat.p                                                    }
  12. {                                                                            }
  13. {    Copyright © 1992-1994 Apple Computer, Inc.                                }
  14. {    All rights reserved.                                                    }
  15. {                                                                            }
  16. {    You may incorporate this sample code into your applications without        }
  17. {    restriction, though the sample code has been provided "AS IS" and the    }
  18. {    responsibility for its operation is 100% yours.  However, what you are    }
  19. {    not permitted to do is to redistribute the source as "DSC Sample Code"    }
  20. {    after having made changes. If you're going to re-distribute the source,    }
  21. {    we require that you make it clear in the source that the code was        }
  22. {    descended from Apple Sample Code, but that you've made changes.            }
  23.  
  24.  
  25. INTERFACE
  26.  
  27.  
  28. {***************************************************************************}
  29.  
  30.  
  31.     FUNCTION FSMakeFSSpecCompat (vRefNum: INTEGER;
  32.                                     dirID: LONGINT;
  33.                                     fileName: Str255;
  34.                                     VAR spec: FSSpec): OSErr;
  35. {    Differences from FSMakeFSSpec:                                            }
  36. {    If the file system can't create the FSSpec, then the compatibility code    }
  37. {    creates a FSSpec that is exactly like an FSSpec except that spec.name    }
  38. {    for a file may not have the same capitalization as the file's catalog    }
  39. {    entry on the disk volume. That is because fileName is parsed to get the    }
  40. {    name instead of getting the name back from the file system. This works    }
  41. {    fine with System 6 where FSMakeSpec isn't available.                    }
  42.  
  43.  
  44. {***************************************************************************}
  45.  
  46.  
  47.     FUNCTION FSpOpenDFCompat (spec: FSSpec;
  48.                                     permission: SignedByte;
  49.                                     VAR refNum: INTEGER): OSErr;
  50. {    Differences from FSpOpenDF:                                                }
  51. {    If FSpOpenDF isn't available, FSpOpenDFCompat uses PHBOpen because        }
  52. {    System 6 doesn't support PBHOpenDF. This means FSpOpenDFCompat could    }
  53. {    accidentally open a driver if the spec->name begins with a period.        }
  54.  
  55.  
  56. {***************************************************************************}
  57.  
  58.  
  59.     FUNCTION FSpOpenRF (spec: FSSpec;
  60.                                     permission: SignedByte;
  61.                                     VAR refNum: INTEGER): OSErr;
  62. {    No known differences from FSpOpenRF.                                    }
  63.  
  64.  
  65. {***************************************************************************}
  66.  
  67.  
  68.     FUNCTION FSpCreate (spec: FSSpec;
  69.                                     creator: OSType;
  70.                                     fileType: OSType;
  71.                                     scriptTag: ScriptCode): OSErr;
  72. {    Differences from FSpCreate:                                                }
  73. {    FSpCreateCompat correctly sets the fdScript in the file's FXInfo record    }
  74. {    to scriptTag.                                                            }
  75.  
  76.  
  77. {***************************************************************************}
  78.  
  79.  
  80.     FUNCTION FSpDirCreate (spec: FSSpec;
  81.                                     scriptTag: ScriptCode;
  82.                                     VAR createdDirID: LONGINT): OSErr;
  83. {    No known differences from FSpDirCreate.                                    }
  84.  
  85.  
  86. {***************************************************************************}
  87.  
  88.  
  89.     FUNCTION FSpDelete (spec: FSSpec): OSErr;
  90. {    No known differences from FSpDelete.                                    }
  91.  
  92.  
  93. {***************************************************************************}
  94.  
  95.  
  96.     FUNCTION FSpGetFInfo (spec: FSSpec;
  97.                                     VAR fndrInfo: FInfo): OSErr;
  98. {    No known differences from FSpGetFInfo.                                    }
  99.  
  100.  
  101. {***************************************************************************}
  102.  
  103.  
  104.     FUNCTION FSpSetFInfo (spec: FSSpec;
  105.                                     fndrInfo: FInfo): OSErr;
  106. {    No known differences from FSpSetFInfo.                                    }
  107.  
  108.  
  109. {***************************************************************************}
  110.  
  111.  
  112.     FUNCTION FSpSetFLock (spec: FSSpec): OSErr;
  113. {    No known differences from FSpSetFLock.                                    }
  114.  
  115.  
  116. {***************************************************************************}
  117.  
  118.  
  119.     FUNCTION FSpRstFLock (spec: FSSpec): OSErr;
  120. {    No known differences from FSpRstFLock.                                    }
  121.  
  122.  
  123. {***************************************************************************}
  124.  
  125.  
  126.     FUNCTION FSpRename (spec: FSSpec;
  127.                                     newName: Str255): OSErr;
  128. {    No known differences from FSpRename.                                    }
  129.  
  130.  
  131. {***************************************************************************}
  132.  
  133.  
  134.     FUNCTION FSpCatMove (source: FSSpec;
  135.                                     dest: FSSpec): OSErr;
  136. {    No known differences from FSpCatMove.                                    }
  137.  
  138.  
  139. {***************************************************************************}
  140.  
  141.  
  142.     FUNCTION FSpExchangeFiles (source: FSSpec;
  143.                                     dest: FSSpec): OSErr;
  144. {    Differences from FSpExchangeFiles:                                        }
  145. {    Correctly exchanges files on volumes that don't support PBExchangeFiles.}
  146. {    FSpExchangeFiles attempts to support volumes that don't support            }
  147. {    PBExchangeFiles, but in System 7, 7.0.1, 7.1, and 7 Pro, the            }
  148. {    compatibility code just doesn't work on volumes that don't support        }
  149. {    PBExchangeFiles (even though you may get a noErr result).                }
  150. {    Future versions of system softare will have the problems in                }
  151. {    FSpExchangeFiles corrected.                                                }
  152.  
  153.  
  154. {***************************************************************************}
  155.  
  156.  
  157.     FUNCTION FSpOpenResFile (spec: FSSpec;
  158.                                     permission: SignedByte): INTEGER;
  159. {    No known differences from FSpOpenResFile.                                }
  160.  
  161.  
  162. {***************************************************************************}
  163.  
  164.  
  165.     PROCEDURE FSpCreateResFile (spec: FSSpec;
  166.                                     creator: OSType;
  167.                                     fileType: OSType;
  168.                                     scriptTag: ScriptCode);
  169. {    Differences from FSpCreateResFile:                                        }
  170. {    FSpCreateResFileCompat correctly sets the fdScript in the file's        }
  171. {    FXInfo record to scriptTag.                                                }
  172.  
  173.  
  174. {***************************************************************************}
  175.  
  176.  
  177. IMPLEMENTATION
  178.  
  179. END.